package com.atguigu.redis;

import redis.clients.jedis.Jedis;

public class testRedis {

    public static void main(String[] args) {
        Jedis jedis=new Jedis("192.168.249.131",6379);
        String pong = jedis.ping();
        System.out.println("连接成功 " + pong);
    }
    public static void main1(String[] args) {
        Jedis jedis=new Jedis("192.168.249.131",6379);
        Long sadd = jedis.sadd("k1", "v1", "k2", "v2");
        System.out.println(sadd);

        String set = jedis.set("k3", "v3");
        System.out.println(set);

        Long hset = jedis.hset("user", "age", "21");
        System.out.println(hset);
        String hget = jedis.hget("user", "age");
        System.out.println(hget);
    }

}
